<?php

namespace Lowpress\PressBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class FeedCommand extends ContainerAwareCommand
{
    public function configure()
    {
      $this
          ->setName('lowpress:importer')
          ->setDescription('Import data from a feed.');
    }

    public function execute(InputInterface $input, OutputInterface $output)
    {
      $feed_definition = $this->getContainer()->get('lowpress.core.feed_gatherer');

      foreach ($feed_definition->getFeedServices() as $feed_service)
      {
          $feed_service->gather($this->getContainer());
      }
    }

}